<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">

<h:head>InvitesReceivedPage</h:head> 
<body> 

	<h:form>
	<!-- User's options from this page -->
		<p:menubar>
			
			<p:submenu label="Event Management">
			 	<p:menuitem value="See events created" action="eventsCreatedPage"/>
 			</p:submenu>
 			
			<p:menuitem value="Calendar Page" action="calendarPage"/>
 			<p:menuitem value="Logout #{userBean.name}" action="#{loginBean.logout()}"/>
		</p:menubar>
      
     </h:form>
    <h:form><p:inputText value="Pendant invites " readonly="true"/><br/></h:form>
	<p:dataList value="#{pendantInvitesBean.pendantInvites}" var="invite" type="ordered" widgetVar="pendInv">
		<h:form>
        	<h:outputText value="#{invite.event.name}"/><br/>
        	<h:outputText value="#{invite.event.datetimebegin}"/><br/>
        	<h:outputText value="#{invite.event.place}"/><br/>
        	<h:outputText value="#{invite.event.weather.condition}"/><br/>
        	<h:outputText value="#{invite.event.weather.temperature}"/><br/>
        </h:form>
        <h:form>
        	<p:selectBooleanCheckbox value="#{pendantInvitesBean.decision}" itemLabel="Mark if you will partecipate"/><br/>
        	<p:commandButton value="Set Partecipation" action="#{pendantInvitesBean.reloadPage}" actionListener="#{pendantInvitesBean.setPartecipation}" oncomplete="PF('pendInv').update(); PF('ackInv').update() ">
        		<f:attribute name="invite" value="#{invite}"/>
        	</p:commandButton>
        </h:form>
        <br/>
	</p:dataList>
	<br/>
	<h:form><p:inputText value="Acknowledged invites " readonly="true"/><br/></h:form>
	
	<p:dataList value="#{invitesConfirmedBean.acks}" var="ack" type="ordered"  widgetVar="ackInv">
		<h:form>
        	<h:outputText value="#{ack.invite.event.name}"/><br/>
        	<h:outputText value="#{ack.invite.event.datetimebegin}"/><br/>
        	<h:outputText value="#{ack.invite.event.place}"/><br/>
        	<h:outputText value="#{ack.response}"/>
        	<br/>
        </h:form>
        <br/>
	</p:dataList>
</body> 
</html>
